package com.questetra.OAuth.apps.Twitter.parser
{
	public class TwitterUser
	{
		public function TwitterUser()
		{
		}

		public var id:uint;
		public var name:String;
		public var screen_name:String;
		public var location:String;
		public var description:uint;
		public var profile_image_url:uint;
		public var url:String;
		public var is_protected:Boolean;
		public var followers_count:uint;
		public var profile_background_color:uint;
		public var profile_text_color:uint;
		public var profile_link_color:uint;
		public var profile_sidebar_fill_color:uint;
		public var profile_sidebar_border_color:uint;
		public var friends_count:uint;
		public var created_at:Date;
		public var favourites_count:uint;
		public var utc_offset:Number;
		public var time_zone:String;
		public var profile_background_image_url:String;
		public var profile_background_tile:Boolean;
		public var notifications:Boolean;
		public var geo_enabled:Boolean;
		public var verified:Boolean;
		public var following:Boolean;
		public var statuses_count:uint;
		
		public function set user_xml(user:XML):void{
			this.id = user.id;
			this.name = user.name;
			this.screen_name = user.screen_name;
			this.location = user.location;
			this.description = user.description;
			this.profile_image_url = user.profile_image_url;
			this.url = user.url;
			this.is_protected = (user.is_protected == "true");
			this.followers_count = user.followers_count;
			this.profile_background_color = uint("0x"+user.profile_background_color);
			this.profile_text_color = uint("0x"+user.profile_text_color);
			this.profile_link_color = uint("0x"+user.profile_link_color);
			this.profile_sidebar_fill_color = uint("0x"+user.profile_sidebar_fill_color);
			this.profile_sidebar_border_color = uint("0x"+user.profile_sidebar_border_color);
			this.friends_count = user.friends_count;
			this.created_at = TwitterDateUtil.TwitterDateToDate(user.created_at);
			this.favourites_count = user.favourites_count;
			this.utc_offset = user.utc_offset;
			this.time_zone = user.time_zone;
			this.profile_background_image_url = user.profile_background_image_url;
			this.profile_background_tile = (user.profile_background_tile == "true");
			this.notifications = (user.notifications == "true");
			this.geo_enabled = (user.geo_enabled == "true");
			this.verified = (user.verified == "true");
			this.following = (user.following == "true");
			this.statuses_count = user.statuses_count;
		}
		
		public function toString():String{
			return "{id:"+this.id+", " + 
					"name:"+this.name+", " + 
					"screen_name:"+this.screen_name + "," + 
					"location:"+this.location+", " + 
					"description:"+this.description+", " + 
					"profile_image_url:"+this.profile_background_image_url+", " + 
					"url:"+this.url+", " + 
					"is_protected:"+this.is_protected+", " + 
					"followers_count:"+this.followers_count+", " + 
					"profile_background_color:"+this.profile_background_color+", " + 
					"profile_text_color:"+this.profile_text_color+", " + 
					"profile_link_color:"+this.profile_link_color+"," + 
					"profile_sidebar_fill_color:"+this.profile_sidebar_fill_color+"," + 
					"profile_sidebar_border_color:"+this.profile_sidebar_border_color+"," + 
					"friends_count:"+this.friends_count+", " + 
					"created_at:"+this.created_at+", " + 
					"favourites_count:"+this.favourites_count+", " + 
					"utc_offset:"+this.utc_offset+", " + 
					"time_zone:"+this.time_zone+", " + 
					"profile_background_image_url:"+this.profile_background_image_url+", " + 
					"profile_background_tile:"+this.profile_background_tile+", " + 
					"notifications:"+this.notifications+", " + 
					"geo_enabled:"+this.geo_enabled+", " + 
					"verified:"+this.verified+", " + 
					"following:"+this.following+", " + 
					"statuses_count:"+this.statuses_count+"}";
		}
	}
}